package com.huli.controller;

import com.huli.domain.HuliAddress;
import com.huli.domain.Patient;
import com.huli.service.HuliAddressService;
import com.huli.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hz/placeAnOrder")
public class PlaceAnOrderController {
    @Autowired
    private HuliAddressService huliAddressService;
    @Autowired
    private PatientService patientService;
    //下单页面展示的地址信息
    @RequestMapping("findAdderss")
    public HuliAddress findAdderss(Integer id){
        HuliAddress huliAddress = huliAddressService.findAll(id);
        return huliAddress;
    }
    //查询所有的地址信息
    @RequestMapping("findAll")
    public List<HuliAddress> findAll(){
        List<HuliAddress> huliAddress = huliAddressService.findAll1();
        return huliAddress;
    }
    //下单页面展示的患者信息
    @RequestMapping("findPatient")
    public Patient findPatient(Integer id){
        Patient patient = patientService.findById(id);
        return patient;
    }
}
